#ifndef SUPPORT_UNICODE
PCRE2_SPTR
-PRIV(extuni)(uint32_t c, PCRE2_SPTR eptr, PCRE2_SPTR start_subject,
+PRIV(extuni)(uint32_t c, PCRE2_SPTR eptr, PCRE2_SPTR check_subject,
PCRE2_SPTR end_subject, BOOL utf, int *xcount)
{
(void)c;
(void)eptr;
-(void)start_subject;
+(void)check_subject;
(void)end_subject;
(void)utf;
(void)xcount;
Arguments:
c the first character
eptr pointer to next character
- start_subject pointer to start of subject
+ check_subject pointer to start of validated subject
end_subject pointer to end of subject
utf TRUE if in UTF mode
xcount pointer to count of additional characters,
*/
PCRE2_SPTR
-PRIV(extuni)(uint32_t c, PCRE2_SPTR eptr, PCRE2_SPTR start_subject,
+PRIV(extuni)(uint32_t c, PCRE2_SPTR eptr, PCRE2_SPTR check_subject,
PCRE2_SPTR end_subject, BOOL utf, int *xcount)
{
BOOL was_ep_ZWJ = FALSE;
/* bptr is pointing to the left-hand character */
- while (bptr > start_subject)
+ while (bptr > check_subject)
{
bptr--;
if (utf)
else
{
GETCHARINCTEST(fc, Feptr);
- Feptr = PRIV(extuni)(fc, Feptr, mb->start_subject, mb->end_subject, utf,
+ Feptr = PRIV(extuni)(fc, Feptr, mb->check_subject, mb->end_subject, utf,
NULL);
}
CHECK_PARTIAL();
else
{
GETCHARINCTEST(fc, Feptr);
- Feptr = PRIV(extuni)(fc, Feptr, mb->start_subject,
+ Feptr = PRIV(extuni)(fc, Feptr, mb->check_subject,
mb->end_subject, utf, NULL);
}
CHECK_PARTIAL();
else
{
GETCHARINCTEST(fc, Feptr);
- Feptr = PRIV(extuni)(fc, Feptr, mb->start_subject, mb->end_subject,
+ Feptr = PRIV(extuni)(fc, Feptr, mb->check_subject, mb->end_subject,
utf, NULL);
}
CHECK_PARTIAL();
else
{
GETCHARINCTEST(fc, Feptr);
- Feptr = PRIV(extuni)(fc, Feptr, mb->start_subject, mb->end_subject,
+ Feptr = PRIV(extuni)(fc, Feptr, mb->check_subject, mb->end_subject,
utf, NULL);
}
CHECK_PARTIAL();
{
for (i = 0; i < Lmax; i++)
{
- if (Feptr == mb->start_subject)
+ if (Feptr <= mb->check_subject)
{
if (i < Lmin) RRETURN(MATCH_NOMATCH);
Lmax = i;
AAA\x80BXYZ
AAA\x80BBXYZ
+# Backward scans must not enter the invalid prefix before check_subject.
+
+/(?<=a{1,2})X/utf,match_invalid_utf
+\= Expect no match
+ \x80X
+
+/\X\X/utf,match_invalid_utf
+\= Expect no match
+ \x80\x{1f1e6}\x{1f1e7}
+
# -------------------------------------
/(*UTF)(?=\x{123})/I
/(..)(*scs:(1)ab$)/match_invalid_utf
ab\x{df00}cde
+# Backward scans must not enter the invalid prefix before check_subject.
+
+/(?<=a{1,2})X/utf,match_invalid_utf
+\= Expect no match
+ \x{dc00}X
+
+/\X\X/utf,match_invalid_utf
+\= Expect no match
+ \x{dc00}\x{1f1e6}\x{1f1e7}
+
# ----------------------------------------------------
/(*UTF)(?=\x{123})/I
AAA\x80BBXYZ
No match
+# Backward scans must not enter the invalid prefix before check_subject.
+
+/(?<=a{1,2})X/utf,match_invalid_utf
+\= Expect no match
+ \x80X
+No match
+
+/\X\X/utf,match_invalid_utf
+\= Expect no match
+ \x80\x{1f1e6}\x{1f1e7}
+No match
+
# -------------------------------------
/(*UTF)(?=\x{123})/I
0: ab
1: ab
+# Backward scans must not enter the invalid prefix before check_subject.
+
+/(?<=a{1,2})X/utf,match_invalid_utf
+\= Expect no match
+ \x{dc00}X
+No match
+
+/\X\X/utf,match_invalid_utf
+\= Expect no match
+ \x{dc00}\x{1f1e6}\x{1f1e7}
+No match
+
# ----------------------------------------------------
/(*UTF)(?=\x{123})/I
0: ab
1: ab
+# Backward scans must not enter the invalid prefix before check_subject.
+
+/(?<=a{1,2})X/utf,match_invalid_utf
+\= Expect no match
+ \x{dc00}X
+No match
+
+/\X\X/utf,match_invalid_utf
+\= Expect no match
+ \x{dc00}\x{1f1e6}\x{1f1e7}
+No match
+
# ----------------------------------------------------
/(*UTF)(?=\x{123})/I